package com.cloud.freeflow.api.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cloud.freeflow.api.entity.BizType;
import com.cloud.freeflow.api.service.BizTypeService;
import com.cloud.freeflow.common.result.Quokka;

@RestController
@RequestMapping("freeflow/api/biz")
public class BizTypeController {

	@Autowired
	private BizTypeService bizService;

	@RequestMapping("list")
	public Quokka listBiz() {
		return new Quokka("data", bizService.listAll());
	}
	
	@RequestMapping("detail")
	public Quokka showDetail(long bizId) {
		return new Quokka("data", bizService.load(bizId));
	}
	
	@RequestMapping("delete")
	public Quokka delete(long bizId){
		return new Quokka("data", bizService.delete(bizId));
	}
	
	@RequestMapping("update")
	public Quokka update(@RequestBody BizType bizType){
		return new Quokka("data", bizService.update(bizType));
	}
}
